{% extends 'index/base.html.twig' %}

{% block title %} {{page.name}} {% endblock %}

{% block banner %} 
    <p class="w">
        <a href="{{path('newslist')}}" style="text-decoration:none;color:#fff;"><span class="mbx">PTE相关资讯</span></a>
        <span>{{page.name}}</span>
    </p>
{% endblock %}

{% block content %}
    <div class="left">
        <h1 class="conTit">{{page.name}}</h1>
        <div class="conTime">{{ page.createdAt|date('Y-m-d H:i')}}</div>
        <div class="conText">
            {% autoescape false %}

                {{ page.content }}
            
            {% endautoescape %}
        </div>
        <div class="tz">
            <div class="pe">
                <span>上一篇: </span>
                {% if (prev) %}
                    <a href="{{path('showNews',{id:prev.id})}}" class="c234">{{prev.name}} </a>
                {% else %}
                    <a href="{{path('newslist')}}" class="c234">返回列表</a>
                {% endif %}
                
            </div>
            <div class="ne">
                <span>下一篇: </span>
                    {% if (next) %}
                    <a href="{{path('showNews',{id:next.id})}}" class="c234">{{next.name}} </a>
                {% else %}
                    <a href="{{path('newslist')}}" class="c234">返回列表</a>
                {% endif %}
            </div>
        </div>
        <div class="wz">
            <div class="wzTit">相关文章</div>
            <div class="wzBox">
                    {% for relation in relations %}   
                    <a href="{{path('showNews',{id:relation.id})}}">{{relation.name}}</a>
                {% endfor %}
            </div>
        </div>
    </div>
{% endblock %}